SUBDIRS=$(shell ls -l|grep ^d|awk '{print $$9}')

CUR_SRC=$(wildcard *.c)
CUR_OBJS=$(patsubst %.c,%.o,${CUR_SRC})

all:${SUBDIRS} ${CUR_OBJS}
$(SUBDIRS):ECHO
	-make -C $@

$(CUR_OBJS):%.o:%.c
	$(CC) ${CFLAGS} -c $^ -o $(ROOT_DIR)/$(OBJS_DIR)/$@

ECHO:
	@echo $(SUBDIRS)
